home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 1.iso / dist / fw_enlightenment.idb / usr / freeware / bin / enlightenment.install.z / enlightenment.install
Text File  |  2001-10-09  |  4KB  |  101 lines

  1. #!/bin/sh
  2. ##############################################################################
  3. # generates user X initialization files to start enlightenment               #
  4. #
  5. # Copyright (C) 1999 Carsten Haitzler, Geoff Harrison  and various contributors
  6. # Permission is hereby granted, free of charge, to any person obtaining a copy
  7. # of this software and associated documentation files (the "Software"), to
  8. # deal in the Software without restriction, including without limitation the
  9. # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  10. # sell copies of the Software, and to permit persons to whom the Software is
  11. # furnished to do so, subject to the following conditions:
  12. # The above copyright notice and this permission notice shall be included in
  13. # all copies of the Software, its documentation and marketing & publicity
  14. # materials, and acknowledgment shall be given in the documentation, materials
  15. # and software packages that this Software was used.
  16. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19. # THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  20. # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  21. # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. ##############################################################################
  23.  
  24. PATH=$PATH:"/usr/local/enlightenment/bin:/usr/enlightenment/bin:/opt/enlightenment/bin:/usr/local/bin:"$EBIN
  25. export PATH
  26.  
  27. if [ -f $HOME"/.xsession" ] || [ -f $HOME"/.xinitrc" ] || [ -f $HOME"/.Xclients" ]; then
  28.   echo 
  29.   echo "******************************* WARNING *****************************"
  30.   echo "* You already have X login startup files. They will be backed up as *"
  31.   echo "*   .old files and new ones will be created. Thank you for using    *"
  32.   echo "                            Enlightenment.                          *"
  33.   echo "*********************************************************************"
  34.   echo
  35.   sleep 3
  36.   #get rid of backup files
  37.   if [ -f $HOME"/.xsession.old" ]; then
  38.     rm -f $HOME"/.xsession.old"
  39.   fi
  40.   if [ -f $HOME"/.xinitrc.old" ]; then
  41.     rm -f $HOME"/.xinitrc.old"
  42.   fi
  43.   if [ -f $HOME"/.Xclients.old" ]; then
  44.     rm -f $HOME"/.Xclients.old"
  45.   fi
  46.   # rename current files
  47.   if [ -f $HOME"/.xsession" ]; then
  48.     mv $HOME"/.xsession" $HOME"/.xsession.old"
  49.   fi
  50.   if [ -f $HOME"/.xinitrc" ]; then
  51.     mv $HOME"/.xinitrc" $HOME"/.xinitrc.old"
  52.   fi
  53.   if [ -f $HOME"/.Xclients" ]; then
  54.     mv $HOME"/.Xclients" $HOME"/.Xclients.old"
  55.   fi
  56.   # get rid of symlinks
  57.   if [ -L $HOME"/.xsession" ]; then
  58.     rm -f $HOME"/.xsession"
  59.   fi
  60.   if [ -L $HOME"/.xinitrc" ]; then
  61.     rm -f $HOME"/.xinitrc"
  62.   fi
  63.   if [ -L $HOME"/.Xclients" ]; then
  64.     rm -f $HOME"/.Xclients"
  65.   fi
  66. fi
  67.  
  68. EBIN=${exec_prefix}/bin
  69. echo "... Generating login startup files ..."
  70. echo "#!/bin/sh" >> $HOME"/.xsession"
  71. echo "# Execute enlightenment. ALWAYS make sure this is at the end of this" >> $HOME"/.xsession"
  72. echo "# startup file - and ALWAYS run things before it with an & at the end." >> $HOME"/.xsession"
  73. echo "# For example:" >> $HOME"/.xsession"
  74. echo "#   xterm &" >> $HOME"/.xsession"
  75. echo "#   kpanel &" >> $HOME"/.xsession"
  76. echo "# It is suggested to use Enlightenment's Remember dialog for having apps" >> $HOME"/.xsession"
  77. echo "# spawned automatically on login." >> $HOME"/.xsession"
  78. echo "exec "$EBIN"/enlightenment" >> $HOME"/.xsession"
  79. # make executable
  80. chmod a+r+x $HOME"/.xsession"
  81. ln -s $HOME"/.xsession" $HOME"/.xinitrc"
  82. ln -s $HOME"/.xsession" $HOME"/.Xclients"
  83. echo "Done."
  84. if [ -f $HOME"/.enlightenment" ]; then
  85.   if [ -f $HOME"/.enlightenment/.initialized" ]; then
  86.     echo "You have installed Enlightenment 0.16 or greater already and have"
  87.     echo "run it before. Everything should be fine."
  88.   else
  89.     echo "You seem to have had either an Enlightenment version earlier than"
  90.     echo "0.16.0 installed or a 0.16 development snapshot. Your .enlightenment"
  91.     echo "directory will be renamed to .enlightenment.old just in case."
  92.     mv $HOME"/.enlightenment" $HOME"/.enlightenment.old"
  93.   fi
  94. fi
  95. echo
  96. echo "Now log out of X and log back in again and enlightenment should be your"
  97. echo "window manager."
  98.